package com.un.ebs.workflow.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.un.ebs.core.exception.BusinessException;
import com.un.ebs.inventory.enums.InventoryTypeEnum;
import com.un.ebs.workflow.domain.WorkflowInstance;
import com.un.ebs.workflow.domain.WorkflowNodeInstanceExt;
import com.un.ebs.workflow.enums.NodePassTypeEnum;

import java.util.List;

/**
 * @author liubo
 * @email liubocs@163.com
 * @date 2020/8/23 17:52
 */
public interface WorkflowInstanceService {

    String start(String workflowId, String remark);

    String start(String workflowId, InventoryTypeEnum type, String noteId, String noteCode);

    String createTask(String workflowInstanceId, String nodeId, String parentId, String remark);

    void taskPush(String nodeInstanceId, String remark, NodePassTypeEnum type);

    void close(String instanceId, String remark, boolean isPass);

    IPage<WorkflowInstance> query(String workflowId, int pageSize, int pageIndex);

    List<WorkflowNodeInstanceExt> queryTask();

    List<WorkflowNodeInstanceExt> queryTask(String workflowInstanceId);

    List<WorkflowNodeInstanceExt> queryTask(String workflowInstanceId, String userId);

    WorkflowNodeInstanceExt queryCurrentTask(String workflowInstanceId, String userId);

    WorkflowNodeInstanceExt queryTaskById(String instanceNodeId);

    WorkflowNodeInstanceExt queryCurrentTaskByInstance(String workflowInstanceId);

    List<WorkflowNodeInstanceExt> queryCurrentTask(String userId);

    WorkflowInstance queryById(String workflowInstanceId);

    void sendPushNotify(String userId, WorkflowNodeInstanceExt node);

    void sendCloseNotify(String userId, String workflowInstanceId, boolean isPass);
}
